package trackClustering.example.entity;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TrajectoryPoint {
    private String id;
    private String deviceId;
    private String deviceName;
    private String time;
    private String trackId;
    private Double attitudeHead;
    private Double attitudePitch;
    private Double attitudeRoll;
    private Double height;
    private Double latitude;
    private Double longitude;
    private Double horizontalSpeed;
    private Double verticalSpeed;
    private String trackType;
    private Double pilotLongitude;
    private Double pilotLatitude;
    private Double targetAngle;
    private String stationId;
    private Double stationLat;
    private Double stationLon;
    private Double rsrp;
    private Double sinr;
    private Integer seq;
    private String deviceTime;
    private Double uploadSpeed;
    private Double easting; // 新增UTM Easting
    private Double northing; // 新增UTM Northing

    // Constructors, getters, and setters

    public TrajectoryPoint(String id, String deviceId, String deviceName, String time, String trackId,
                           Double attitudeHead, Double attitudePitch, Double attitudeRoll, Double height,
                           Double latitude, Double longitude, Double horizontalSpeed, Double verticalSpeed,
                           String trackType, Double pilotLongitude, Double pilotLatitude, Double targetAngle,
                           String stationId, Double stationLat, Double stationLon, Double rsrp,
                           Integer seq, String deviceTime, Double uploadSpeed, Double easting, Double northing) {
        this.id = id;
        this.deviceId = deviceId;
        this.deviceName = deviceName;
        this.time = time;
        this.trackId = trackId;
        this.attitudeHead = attitudeHead;
        this.attitudePitch = attitudePitch;
        this.attitudeRoll = attitudeRoll;
        this.height = height;
        this.latitude = latitude;
        this.longitude = longitude;
        this.horizontalSpeed = horizontalSpeed;
        this.verticalSpeed = verticalSpeed;
        this.trackType = trackType;
        this.pilotLongitude = pilotLongitude;
        this.pilotLatitude = pilotLatitude;
        this.targetAngle = targetAngle;
        this.stationId = stationId;
        this.stationLat = stationLat;
        this.stationLon = stationLon;
        this.rsrp = rsrp;
        this.sinr = sinr;
        this.seq = seq;
        this.deviceTime = deviceTime;
        this.uploadSpeed = uploadSpeed;
        this.easting = easting;
        this.northing = northing;
    }

    public TrajectoryPoint(double pointEasting, double pointNorthing, double pointHeight) {
        this.easting = pointEasting;
        this.northing = pointNorthing;
        this.height = pointHeight;
    }

    // Getters and setters

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getTime() {
        return time;
    }
    // 新增时间戳转换方法
    public long getTimeStamp() {
        try {
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm");
            Date date = formatter.parse(time);
            return date.getTime(); // 返回毫秒级时间戳
        } catch (ParseException e) {
            throw new IllegalArgumentException("Invalid time format: " + time);
        }
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getTrackId() {
        return trackId;
    }

    public void setTrackId(String trackId) {
        this.trackId = trackId;
    }

    public Double getAttitudeHead() {
        return attitudeHead;
    }

    public void setAttitudeHead(Double attitudeHead) {
        this.attitudeHead = attitudeHead;
    }

    public Double getAttitudePitch() {
        return attitudePitch;
    }

    public void setAttitudePitch(Double attitudePitch) {
        this.attitudePitch = attitudePitch;
    }

    public Double getAttitudeRoll() {
        return attitudeRoll;
    }

    public void setAttitudeRoll(Double attitudeRoll) {
        this.attitudeRoll = attitudeRoll;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getHorizontalSpeed() {
        return horizontalSpeed;
    }

    public void setHorizontalSpeed(Double horizontalSpeed) {
        this.horizontalSpeed = horizontalSpeed;
    }

    public Double getVerticalSpeed() {
        return verticalSpeed;
    }

    public void setVerticalSpeed(Double verticalSpeed) {
        this.verticalSpeed = verticalSpeed;
    }

    public String getTrackType() {
        return trackType;
    }

    public void setTrackType(String trackType) {
        this.trackType = trackType;
    }

    public Double getPilotLongitude() {
        return pilotLongitude;
    }

    public void setPilotLongitude(Double pilotLongitude) {
        this.pilotLongitude = pilotLongitude;
    }

    public Double getPilotLatitude() {
        return pilotLatitude;
    }

    public void setPilotLatitude(Double pilotLatitude) {
        this.pilotLatitude = pilotLatitude;
    }

    public Double getTargetAngle() {
        return targetAngle;
    }

    public void setTargetAngle(Double targetAngle) {
        this.targetAngle = targetAngle;
    }

    public String getStationId() {
        return stationId;
    }

    public void setStationId(String stationId) {
        this.stationId = stationId;
    }

    public Double getStationLat() {
        return stationLat;
    }

    public void setStationLat(Double stationLat) {
        this.stationLat = stationLat;
    }

    public Double getStationLon() {
        return stationLon;
    }

    public void setStationLon(Double stationLon) {
        this.stationLon = stationLon;
    }

    public Double getRsrp() {
        return rsrp;
    }

    public void setRsrp(Double rsrp) {
        this.rsrp = rsrp;
    }

    public Double getSinr() {
        return sinr;
    }

    public void setSinr(Double sinr) {
        this.sinr = sinr;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getDeviceTime() {
        return deviceTime;
    }

    public void setDeviceTime(String deviceTime) {
        this.deviceTime = deviceTime;
    }

    public Double getUploadSpeed() {
        return uploadSpeed;
    }

    public void setUploadSpeed(Double uploadSpeed) {
        this.uploadSpeed = uploadSpeed;
    }

    public Double getEasting() {
        return easting;
    }

    public void setEasting(Double easting) {
        this.easting = easting;
    }

    public Double getNorthing() {
        return northing;
    }

    public void setNorthing(Double northing) {
        this.northing = northing;
    }
}